package com.zhq.action;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zhq.Interface.action.IUserAction;

public class UserActionTest {
	
	private UserAction userAction;
	private static ClassPathXmlApplicationContext ctx;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		ctx = new ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"});
	}
	
	@Before
	public void setUp() throws Exception {
		userAction = (UserAction)ctx.getBean("userAction");
	}
	
	@Test
	public void testLogin() {
		String nameString = "q";
		userAction.setNameString(nameString);
		userAction.login();
	}
	
}
